home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 27 / IOPROG_27.ISO / SOFT / TDROPFL.ZIP / TMultiDropFile / Demo / Demo Source (Delphi) / Unit1.pas < prev   
Encoding:
Pascal/Delphi Source File  |  1998-02-14  |  1.2 KB  |  58 lines

  1. unit Unit1;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   StdCtrls, ExtCtrls, ComCtrls, MultiDropFile;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     MultiDropFile1: TMultiDropFile;
  12.     ListBox1: TListBox;
  13.     StatusBar1: TStatusBar;
  14.     Panel1: TPanel;
  15.     Image1: TImage;
  16.     Label1: TLabel;
  17.     procedure FormShow(Sender: TObject);
  18.     procedure FormClose(Sender: TObject; var Action: TCloseAction);
  19.     procedure MultiDropFile1FileDrop(Sender: TObject;
  20.       numberOfFiles: Integer);
  21.   private
  22.     { Private declarations }
  23.   public
  24.     { Public declarations }
  25.   end;
  26.  
  27. var
  28.   Form1: TForm1;
  29.  
  30. implementation
  31.  
  32. {$R *.DFM}
  33.  
  34. procedure TForm1.FormShow(Sender: TObject);
  35. begin
  36.   MultiDropFile1.enableDropFile(form1.handle);
  37. end;
  38.  
  39. procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
  40. begin
  41.   MultiDropFile1.disableDropFile;
  42. end;
  43.  
  44. procedure TForm1.MultiDropFile1FileDrop(Sender: TObject;
  45.   numberOfFiles: Integer);
  46. Var
  47.   n: Integer;
  48. begin
  49.   ListBox1.clear;
  50.   statusBar1.simpleText:=intToStr(numberOfFiles) + ' files dropped';
  51.   for n:=1 to numberOfFiles do
  52.     begin
  53.       listbox1.items.add(MultiDropFile1.FileName[n]);
  54.     end;
  55. end;
  56.  
  57. end.
  58.